<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
<title></title>
</head>
<body>
<div id="app">

<table border="1px">
	<tr>
		<th>编号</th>
		<th>姓名</th>
		<th>性别</th>
	</tr>
</table>
		
</div>
<script>
	$(function(){
		$.getJSON('./user.json','',function(data){
			$.each(data,function(i,item){
				item.forEach(o=>appendP(o));
			})
		})
		function appendP(Obj){
			$('table').append(`
			<tr>
				<td>${Obj.id}</td>
				<td>${Obj.name}</td>
				<td>${Obj.sex}</td>
			</tr>
			`)
		}
		
	})
	
	
	// data.student.forEach(o=>$("#app").append(o.id+" "+o.name+" "+o.sex+"</br>"))
	// console.log(data);
	// console.log('111');
	// console.log(data.student);
	// <p>${Obj.id} ${Obj.name} ${Obj.sex}</p>
</script>
</body>
</html>
